home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / firstbas.zip / CAPS.BAS < prev    next >
BASIC Source File  |  1996-08-01  |  1KB  |  36 lines

  1. '┌───────────────────────────────────────────────────────────────────────────┐
  2. '│                                                                           │
  3. '│  Utility to toggle the CAPS lock status on or off.                        │
  4. '│  Copyright (c) 1995 by PowerBASIC, Inc.  All Rights Reserved.             │
  5. '│                                                                           │
  6. '└───────────────────────────────────────────────────────────────────────────┘
  7.  
  8. $COMPILE EXE
  9. DEFINT A - Z
  10.  
  11. PRINT "CAPS v1.0 ■ Toggle CAPS LOCK status"
  12. PRINT "Copyright (c) 1995 by PowerBASIC, Inc.  All Rights Reserved."
  13. PRINT ""
  14.  
  15. Cmd$ = UCASE$( COMMAND$ )
  16. IF ( Cmd$ = "ON" ) OR ( Cmd$ = "+" ) THEN
  17.   Stat = 1
  18. ELSEIF ( Cmd$ = "OFF" ) OR ( Cmd$ = "-" ) THEN
  19.   Stat = 0
  20. ELSE
  21.   PRINT "Usage:  CAPS on|off|+|-"
  22.   END 1
  23. END IF
  24.  
  25. DEF SEG = 0
  26.   X = PEEK( &H417 )  'get keyboard toggles
  27.   IF Stat THEN
  28.     X = X OR &B01000000
  29.     PRINT "CAPS LOCK is now ON"
  30.   ELSE
  31.     X = X AND &B10111111
  32.     PRINT "CAPS LOCK is now OFF"
  33.   END IF
  34.   POKE &H417, X      'set keyboard toggles
  35. DEF SEG
  36.